package cn.lookup.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@Controller
public class UploadController {
    @RequestMapping("/upload")
    @ResponseBody
    public void upload(String filename, MultipartFile[] files) throws IOException {
        for (MultipartFile file : files) {
            String originalFilename = file.getOriginalFilename();
            file.transferTo(new File("D:\\test\\upload\\barcode\\"+originalFilename));
        }
    }
}
